package com.mengdie.shuidi.ui.adapter;

import android.view.View;
import android.widget.RelativeLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.mengdie.shuidi.R;
import com.mengdie.shuidi.model.CollectEntity;

import java.util.List;

/**
 * 作者：HQY on 17/8/9 15:46
 * 邮箱：hqy_xz@126.com
 */

public class CollectAdapter extends BaseQuickAdapter<CollectEntity, BaseViewHolder> {


    public CollectAdapter(List<CollectEntity> data) {
        super(R.layout.item_model_collect, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, CollectEntity item) {
        helper.setText(R.id.tv_collect_name, item.getName())
                .addOnClickListener(R.id.rl_group_delete);
        RelativeLayout mRlDelete = helper.getView(R.id.rl_group_delete);
        if (helper.getAdapterPosition() == 0) {
            mRlDelete.setVisibility(View.GONE);
        } else {
            if (item.isShow()) {
                mRlDelete.setVisibility(View.VISIBLE);
            } else {
                mRlDelete.setVisibility(View.GONE);
            }
        }
    }

}
